package com.pubinfo.passbook.common.model.constant;

public enum RoleEnum {
  
  ADMIN("管理员", "passbook_admin"),
  USER("普通用户", "passbook_user"),
  AUDITOR("医药费审核员", "passbook_bill_auditor"),
  Department("部门报销员", "passbook_reimbursement_clerk");
  
  public String roleName;
  public String roleCode;
  
  RoleEnum(String roleName, String roleCode) {
    this.roleCode = roleCode;
    this.roleName = roleName;
  }
  
  public String getRoleName() {
    return this.roleName;
  }
  
  public String getRoleCode() {
    return this.roleCode;
  }
  
  public static String getRoleCode(String key) {
    for (RoleEnum e : RoleEnum.values()) {
      if (e.getRoleName().equals(key)) {
        return e.getRoleCode();
      }
    }
    return null;
  }
}
